package shortcircuit.utilities;

/**
 * This class helps us perform debugging actions by allowing the output of various variables
 * during runtime as indicated by an internal boolean. This boolean can be switched on and off
 * to toggle this "debugging mode".
 * 
 * @author David Li
 */
public class Debug {
	static boolean isActive = false;
	
	/**
	 * Prints out the selected string or not depending on isActive.
	 * 
	 * @param theString The string to be printed out using System.out.println
	 * 
	 * @author David Li
	 */
	public static void println(String theString){
		if(isActive)
			System.out.println(theString);
	}
	
	/**
	 * Prints out the selected integer or not depending on isActive.
	 * 
	 * @param theInt The integer to be printed out using System.out.println
	 * 
	 * @author David Li
	 */
	public static void println(int theInt){
		if(isActive)
			System.out.println(theInt);
	}
	
	/**
	 * Prints out the selected double or not depending on isActive.
	 * 
	 * @param theDouble The double to be printed out using System.out.println
	 * 
	 * @author David Li
	 */
	public static void println(double theDouble){
		if(isActive)
			System.out.println(theDouble);
	}
	
	/**
	 * Prints out the selected boolean or not depending on isActive.
	 * 
	 * @param theBoolean The boolean to be printed out using System.out.println
	 * 
	 * @author David Li
	 */
	public static void println(boolean theBoolean){
		if(isActive)
			System.out.println(theBoolean);
	}
	
	/**
	 * Turns the Debug class off.
	 * 
	 * @author David Li
	 */
	public static void on(){
		isActive = true;
	}
	
	/**
	 * Turns the Debug class on.
	 * 
	 * @author David Li
	 */
	public static void off(){
		isActive = false;
	}
}
